import { pget, ppostJson } from '@/utils/req'
import { modalApi } from '@/utils/modalReq'

/**
 * 司机结算审核列表
 * @param query
 * @returns
 */
export async function getProcessPage(query: any): Promise<any> {
	return pget(`${modalApi.marketing}/marketingsettlementdriver/page`, query)
}

/**
 * 司机结算审核详情-审核记录
 * @param query
 * @returns
 */
export async function getProcessList(query: any): Promise<any> {
	return pget(
		`${modalApi.marketing}/marketingsettlementdriver/processList`,
		query,
	)
}
/**
 * 补扣费审核记录
 * @param query
 * @returns
 */
export async function getAuditRecordList(query: any): Promise<any> {
	return pget(`${modalApi.marketing}/deductionauditrecord/auditRecord`, query)
}

/**
 * 司机结算审核详情
 * @param query
 * @returns
 */
export async function getRecordDetail(query: any): Promise<any> {
	return pget(`${modalApi.marketing}/marketingsettlementdriver/detail`, query)
}
/**
 * 补扣费操作记录
 * @param query
 * @returns
 */
export async function getOperationRecord(query: any): Promise<any> {
	return pget(
		`${modalApi.marketing}/deductionauditrecord/operationRecord`,
		query,
	)
}
/**
 * 审核列表输入备注
 * @param data
 * @returns
 */
export async function getOperationUpdate(data: any): Promise<any> {
	return ppostJson(
		`${modalApi.marketing}/marketingsettlementdriver/update`,
		data,
	)
}

/**
 * 明细列表输入备注
 * @param data
 * @returns
 */
export async function getSettlementUpdate(data: any): Promise<any> {
	return ppostJson(
		`${modalApi.marketing}/settlementawarddetails/update`,
		data,
	)
}

/**
 * 批量置为已发放
 * @param data
 * @returns
 */
export async function postPhysicalDistribution(data: any): Promise<any> {
	return ppostJson(
		`${modalApi.marketing}/marketingsettlementdriver/physicalDistribution?ids=${data?.ids}`,
		data,
	)
}

/**
 * 批量置为已返现
 * @param data
 * @returns
 */
export async function postCashBackDistribution(data: any): Promise<any> {
	return ppostJson(
		`${modalApi.marketing}/marketingsettlementdriver/cashBackDistribution?ids=${data?.ids}`,
		data,
	)
}

/**
 * 单个(批量)审核
 * @param data
 * @returns
 */
export async function batchApproval(data: any): Promise<any> {
	return ppostJson(
		`${modalApi.marketing}/marketingsettlementdriver/processAuditSuccess`,
		data,
	)
}

/**
 * 编辑补扣费
 * @param data
 * @returns
 */
export async function save(data: any): Promise<any> {
	return ppostJson(
		`${modalApi.marketing}/settlementawarddetails/save`,
		data,
	)
}

/**
 * 补扣费审核
 * @param data
 * @returns
 */
export async function feeSave(data: any): Promise<any> {
	return ppostJson(
		`${modalApi.marketing}/deductionauditrecord/submit`,
		data,
	)
}

